.ai-assistant {
  height: 100%;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  user-select: none;
  transition: all 0.3s ease;
  position: relative;
}

.collapse-button {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #1890ff;
  cursor: pointer;
  z-index: 1001;
  transition: all 0.3s;
  border: none;
  padding: 0;
  box-shadow: none;
}

.collapse-button:hover {
  color: #40a9ff;
  background: transparent;
  transform: scale(1.1);
}

.collapse-button:active {
  transform: scale(0.9);
}

.collapse-button .anticon {
  font-size: 20px;
  transition: all 0.3s;
}

.ai-assistant.collapsed {
  background: #fff;
}

.ai-assistant.collapsed .collapse-button {
  left: 4px;
  color: #bfbfbf;
}

.ai-assistant.collapsed .collapse-button:hover {
  color: #1890ff;
}

/* 移除 ant-btn 的默认样式 */
.collapse-button.ant-btn {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  color: #1890ff !important;
  cursor: pointer;
  z-index: 1001;
  transition: all 0.3s;
  border: none !important;
  padding: 0;
  box-shadow: none !important;
}

.collapse-button.ant-btn:hover {
  transform: scale(1.1);
  background: transparent !important;
  color: #1890ff !important;
}

.collapse-button.ant-btn .anticon {
  font-size: 20px;
  transition: all 0.3s;
}

.ai-assistant.collapsed .collapse-button.ant-btn {
  left: 4px;
  color: #bfbfbf !important;
}

.ai-assistant.collapsed .collapse-button.ant-btn:hover {
  color: #1890ff !important;
}

/* 移除其他 ant-btn 的默认样式 */
.collapse-button.ant-btn:focus,
.collapse-button.ant-btn:active {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #1890ff !important;
}

/* 消息列表区域 */
.ai-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* 输入区域 */
.ai-input-container {
  flex-shrink: 0;
  padding: 12px;
  background: #f0f2f5;
  border-top: 1px solid #e8e8e8;
}

.input-wrapper {
  margin-bottom: 8px;
  position: relative;
}

.new-chat-button {
  position: absolute;
  right: 8px;
  top: -28px;
  z-index: 1;
  padding: 4px;
  height: 24px;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  transition: all 0.3s;
  border-radius: 4px;
  background: transparent;
}

.new-chat-button:hover {
  color: #1890ff;
  background: rgba(24, 144, 255, 0.1);
  transform: scale(1.1);
}

.new-chat-button:active {
  transform: scale(0.95);
}

.new-chat-button .anticon {
  font-size: 16px;
  transition: transform 0.3s;
}

.new-chat-button:hover .anticon {
  transform: rotate(90deg);
}

.input-wrapper .ant-input {
  border-color: #d9d9d9;
  resize: none;
  font-size: 13px;
  height: 60px;
  min-height: 60px;
  padding: 8px 12px;
  line-height: 1.5;
}

.button-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  gap: 8px;
}

.button-wrapper .left-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button-wrapper .right-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-input-container .ant-input {
  background: #fff;
  border-radius: 4px;
}

.ai-input-container .ant-btn {
  align-self: flex-end;
}

.message {
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 8px;
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message.user {
  margin-left: 48px;
  background: #e6f7ff;
}

.message.assistant {
  margin-right: 48px;
  background: #fff;
}

.message-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.message-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #e6f7ff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
}

.message.user .message-avatar {
  background-color: #f0f5ff;
}

.message-avatar .anticon {
  font-size: 14px;
  color: #1890ff;
}

.message.user .message-avatar .anticon {
  color: #2f54eb;
}

.message-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-sender {
  font-weight: 500;
  color: #333;
}

.message-time {
  font-size: 12px;
  color: #999;
}

.copy-button {
  opacity: 0;
  transition: opacity 0.2s;
}

.message:hover .copy-button {
  opacity: 1;
}

.message-content {
  margin-left: 1px;
  color: #333;
  line-height: 1.6;
}

.message-content pre {
  margin: 8px 0;
  border-radius: 4px;
}

.message-content code {
  font-family: 'Fira Code', Consolas, Monaco, 'Andale Mono', monospace;
  font-size: 14px;
}

.message-content p {
  margin: 0;
}

/* 命令建议样式 */
.command-suggestion {
  margin-top: 12px;
  padding: 12px;
  border-radius: 6px;
  background-color: #fff;
  border: 1px solid #e8e8e8;
}

.command-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  padding: 8px;
}

.command-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.command-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.command-text {
  display: block;
  background-color: #f5f5f5;
  padding: 8px 12px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.command-text code {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 13px;
  color: #333;
  display: block;
  width: 100%;
}

.command-buttons {
  display: flex;
  gap: 4px;
  padding: 4px 0;
  align-items: center;
}

.command-buttons .ant-btn,
.command-buttons .regenerate-button {
  font-size: 12px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid #d9d9d9;
  border-radius: 2px;
  color: #666;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 4px;
}

.command-buttons .ant-btn:hover,
.command-buttons .regenerate-button:hover {
  color: #1890ff;
  border-color: #1890ff;
  background: rgba(24, 144, 255, 0.1);
}

.command-buttons .ant-btn .anticon,
.command-buttons .regenerate-button .anticon {
  font-size: 12px;
}

.command-buttons .ant-btn-dangerous {
  color: #ff4d4f;
  border-color: #ff4d4f;
}

.command-buttons .ant-btn-dangerous:hover {
  color: #ff7875;
  border-color: #ff7875;
  background: rgba(255, 77, 79, 0.1);
}

.command-header .ant-btn {
  padding: 2px 6px;
  font-size: 12px;
  height: 24px;
  min-width: 50px;
}

.command-header .ant-btn-text {
  border: none;
}

.command-header .ant-btn-text:hover {
  background-color: rgba(24, 144, 255, 0.1);
}

.command-header .ant-btn-text .anticon {
  font-size: 12px;
  margin-right: 4px;
}

.command-example {
  margin-top: 12px;
  padding: 8px 12px;
  background-color: #fafafa;
  border-radius: 4px;
}

.command-example h4 {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: #333;
}

.command-example code {
  display: block;
  background-color: #f0f0f0;
  padding: 6px 8px;
  border-radius: 3px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  color: #333;
}

.command-parameters {
  margin-top: 12px;
  padding: 8px 12px;
  background-color: #fafafa;
  border-radius: 4px;
}

.command-parameters h4 {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: #333;
}

.command-parameters ul {
  margin: 0;
  padding-left: 20px;
}

.command-parameters li {
  margin: 4px 0;
  font-size: 12px;
  color: #666;
}

.command-parameters code {
  background-color: #f0f0f0;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: 'Consolas', 'Courier New', monospace;
}

.risk-alert {
  margin-bottom: 12px;
}

/* 自定义滚动条样式 */
.ai-messages::-webkit-scrollbar {
  width: 6px;
}

.ai-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.ai-messages::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.ai-messages::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* 动画效果 */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.command-header .ant-btn-text:hover .anticon-sync {
  animation: rotate 1s linear infinite;
}

.button-wrapper .ant-radio-group {
  display: flex;
  align-items: center;
}

.button-wrapper .ant-radio-button-wrapper {
  border: none;
  background: transparent;
  padding: 2px 8px;
  height: 24px;
  font-size: 12px;
  display: flex;
  align-items: center;
}

.button-wrapper .ant-radio-button-wrapper:hover {
  color: #1890ff;
}

.button-wrapper .ant-radio-button-wrapper-checked {
  color: #1890ff;
  font-weight: 500;
}

.button-wrapper .ant-radio-button-wrapper-checked::before {
  display: none;
}

.button-wrapper .ant-btn {
  border: none;
  background: transparent;
  padding: 2px 8px;
  height: 24px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.button-wrapper .ant-btn:hover {
  color: #1890ff;
  background: transparent;
}

.button-wrapper .ant-btn .anticon {
  font-size: 16px;
}

.explanation-content {
  margin-bottom: 12px;
  padding: 8px;
  background-color: #f5f5f5;
  border-radius: 4px;
  color: #666;
  font-size: 14px;
}

.text-content {
  margin-bottom: 8px;
  line-height: 1.5;
}

.command-description {
  margin: 8px 0;
  padding: 8px 12px;
  background-color: #fafafa;
  border-left: 3px solid #1890ff;
  border-radius: 2px;
  color: #666;
  font-size: 13px;
  line-height: 1.5;
}

.command-wrapper {
  position: relative;
  margin-bottom: 12px;
}

.regenerate-button {
  font-size: 12px !important;
  height: 22px !important;
  padding: 0 8px !important;
  border: 1px solid #d9d9d9 !important;
  border-radius: 2px !important;
  color: #666 !important;
  background: transparent !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  position: static !important;
  margin-left: 4px !important;
  opacity: 1 !important;
}

.regenerate-button:hover {
  color: #1890ff !important;
  border-color: #1890ff !important;
  background: rgba(24, 144, 255, 0.1) !important;
}

.regenerate-button .anticon {
  font-size: 12px !important;
}

.command-buttons {
  display: flex;
  gap: 4px;
  padding: 4px 0;
  align-items: center;
}

.required {
  color: #ff4d4f;
  margin-left: 4px;
}

.default-value {
  color: #8c8c8c;
  margin-left: 4px;
}

.ai-header {
  flex-shrink: 0;
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
}

.ai-header .ant-btn {
  border: none;
  background: transparent;
  padding: 2px 8px;
  height: 24px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ai-header .ant-btn:hover {
  color: #1890ff;
  background: rgba(24, 144, 255, 0.1);
}

.ai-header .ant-btn .anticon {
  font-size: 14px;
}

.button-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.button-wrapper .ant-radio-group {
  display: flex;
  align-items: center;
}

.button-wrapper .ant-radio-button-wrapper {
  border: none;
  background: transparent;
  padding: 2px 8px;
  height: 24px;
  font-size: 12px;
  display: flex;
  align-items: center;
}

.button-wrapper .ant-radio-button-wrapper:hover {
  color: #1890ff;
}

.button-wrapper .ant-radio-button-wrapper-checked {
  color: #1890ff;
  font-weight: 500;
}

.button-wrapper .ant-radio-button-wrapper-checked::before {
  display: none;
}

.button-wrapper .ant-btn {
  border: none;
  background: transparent;
  padding: 2px 8px;
  height: 24px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.button-wrapper .ant-btn:hover {
  color: #1890ff;
  background: transparent;
}

.button-wrapper .ant-btn .anticon {
  font-size: 16px;
} 